﻿using System.Windows;
using System.Windows.Controls;

namespace Tfs.OnTheRoad.Controls
{
    /// <summary>
    /// Application Header Control, showed in all screens
    /// </summary>
	public partial class HeaderControl : UserControl
	{
       
        public HeaderControl()
		{
			// Required to initialize variables
			InitializeComponent();
            //Avoiding errors on design time mainly
            try
            {
                if (App.SettingsViewModel != null)
                    profileTextBox.DataContext = App.SettingsViewModel;
            }
            catch { }
            
		}

        public string HeaderTitle
        {
            get { return (string)GetValue(HeaderTitleProperty); }
            set { SetValue(HeaderTitleProperty, value); }
        }

        public static readonly DependencyProperty HeaderTitleProperty =
            DependencyProperty.Register("HeaderTitle", typeof(string), typeof(HeaderControl), null);


        public Visibility ProfileNameVisibility
        {
            get { return (Visibility)GetValue(ProfileVisibilityProperty); }
            set { SetValue(ProfileVisibilityProperty, value); }
        }

        public static readonly DependencyProperty ProfileVisibilityProperty =
            DependencyProperty.Register("ProfileNameVisibility", typeof(Visibility), typeof(HeaderControl), null);


        public string NavigationPath
        {
            get { return (string)GetValue(NavigationPathProperty); }
            set { SetValue(NavigationPathProperty, value); }
        }

        public static readonly DependencyProperty NavigationPathProperty =
            DependencyProperty.Register("NavigationPath", typeof(string), typeof(HeaderControl), null);
	}
}